import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import GoodsBuy from "../views/GoodsBuy";
import LiveList from "../views/LiveList";
import CatePage from "../views/CatePage";
import Recommd from "../components/Recommd";
import ShoppingCar from "../views/ShoppingCar";
import User from "../views/User";
import IndexTabsPage from "../views/IndexTabsPage";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    children:[
       {
      path:"",
      component:IndexTabsPage
      },
      {
        path: "/video",
        component: LiveList
      },
      {
        path: "/cate",
        component: CatePage
      },
      {
        path:'/shopping',
        component: ShoppingCar
      },
      {
        path: '/user',
        component: User
      }
    ]
  },
  {
    path:"/goodsBuy",
    name:"GoodsBuy",
    component: GoodsBuy
  },
  {
    path: "/video",
    name:"LiveList",
    component: LiveList
  },
  {
    path:"/cate",
    name:"CatePage",
    component: CatePage
  }


]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes,
  scrollBehavior(to,from,savedPosition){
    return{
      x:0,
      y:0
    }
  }
})

export default router
